UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R6tJx3/fCAK5j6I4AbClz2GZr63cmjzC/NW76V7H3Rw='
WHERE
key_id = '4d93d62ff4a1a8de5bc291e27c2bd4e6f48469a2cffc9679f33647af4d7faaa4'
AND (
token = 'R6tJx3/fCAK5j6I4AbClz2GZr63cmjzC/NW76V7H3Rw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)