UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rBVWGYAJ8eqfBGyPC2yvrKl3GiUwx4BDBh7ojKhTDzs='
WHERE
key_id = 'bfc069f795fdd09c9aa117f4d507c4ce8a17c9f64960e98d3a4e647b7dfb4cf7'
AND (
token = 'rBVWGYAJ8eqfBGyPC2yvrKl3GiUwx4BDBh7ojKhTDzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)