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