UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nCrc8BwjEyepPhkS572jeCMVflxXk/4vTuVqyQGTHEI='
WHERE
key_id = 'dc2b3c50454fb760ee1eadbcca1a9b67283a758c5d464e63d82c24bed84a4211'
AND (
token = 'nCrc8BwjEyepPhkS572jeCMVflxXk/4vTuVqyQGTHEI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)