UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bxNotSoNzTafy+pMoptM124H7NcEJL75jy41DgBz2qc='
WHERE
key_id = '53668d9519a4c13b3c2b570f8f76a3f521b47af9188787022951e7baa982bd49'
AND (
token = 'bxNotSoNzTafy+pMoptM124H7NcEJL75jy41DgBz2qc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)