UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kxbwm6gAw2AWtvQz4T/fEoWrhzbGR/N+ghqs3zDIcPA='
WHERE
key_id = '714116f92218f318120d557918d066fc5bb5b0042a9aa1b4dd873a1f6ba091d0'
AND (
token = 'kxbwm6gAw2AWtvQz4T/fEoWrhzbGR/N+ghqs3zDIcPA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)