UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'io7J70GGyUp+xY6iO4BSKqwmCbWVSkB1mbRhsvQ7hsQ='
WHERE
key_id = '974056762d93d574c2815c8657d0d42ed35d92211c4a8fa06ceb1ea53d322d8a'
AND (
token = 'io7J70GGyUp+xY6iO4BSKqwmCbWVSkB1mbRhsvQ7hsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)