UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RbEIoYX7GnVmH/nmUSHMKcD3wF4uIkxIZIIViBxLw2w='
WHERE
key_id = 'e4a7e196b8c5d550816c0dee301df6831f5514ae3e677f29489155858ba2344e'
AND (
token = 'RbEIoYX7GnVmH/nmUSHMKcD3wF4uIkxIZIIViBxLw2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)