UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UEiteo3Um9lnrzv+B1YPiYS4PdbmClsglGZnehAoUy8='
WHERE
key_id = '4674fc112c8bc7e08d72fed16b838956c0efc51bdaa92e5612bf931cff7aaa30'
AND (
token = 'UEiteo3Um9lnrzv+B1YPiYS4PdbmClsglGZnehAoUy8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)