UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8yzojjlqteJbMEjkdK8SPyuOtW5g+YR48ufSzN2RLKk='
WHERE
key_id = '8628569e16e48c6fb4b7733ea5542ebab4d46d65496a70ea6281e4536cf7113a'
AND (
token = '8yzojjlqteJbMEjkdK8SPyuOtW5g+YR48ufSzN2RLKk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)