UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OzZVsfVQTgy3XFJxpBxsPldLJROzyLoGUUfX9kZf0HM='
WHERE
key_id = '7a067ac2b2ace3c02350e25b45fed1ac5b201037401a688510daac7da2c6bea2'
AND (
token = 'OzZVsfVQTgy3XFJxpBxsPldLJROzyLoGUUfX9kZf0HM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)