UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UNmqgS4vmvTJ/ZFNjqrdQn6lV2ENwYjaVQCR/Jls2lM='
WHERE
key_id = '8b52eb2eeb4ca893a5f87dc5768c82f2121988d8bfa46611529a7f24dc8cf702'
AND (
token = 'UNmqgS4vmvTJ/ZFNjqrdQn6lV2ENwYjaVQCR/Jls2lM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)