UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '14KnpJY3TnaQP3jPnEZX6st3Oyx+zFyO0m0z9lSonEM='
WHERE
key_id = '7e7ec7d76487deb87f58ab2ca218e253104186fa957ba1e8fd576ea848bfdd24'
AND (
token = '14KnpJY3TnaQP3jPnEZX6st3Oyx+zFyO0m0z9lSonEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)