UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cL4I7hH/z4hpgl4DQYK+nHL1lp2O9tNxAe7qZdjQN8g='
WHERE
key_id = 'f835b66f6d8baf578f8a09d97bd25f421b3dc8c577a1e0d74d9b2b9822d72b76'
AND (
token = 'cL4I7hH/z4hpgl4DQYK+nHL1lp2O9tNxAe7qZdjQN8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)