UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mj5Y36onxipCfM5d9ceoYA9my1Cn6vNUOW6uhyEcwUU='
WHERE
key_id = '6b35784b0764f86ec4bf79a37dc30743378e029c36b2b042a7f03dd3cf1bfc84'
AND (
token = 'mj5Y36onxipCfM5d9ceoYA9my1Cn6vNUOW6uhyEcwUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)