UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rr0FwMq4sFHBHYq1/zu/kOWHKA9j64EpIJQ3dtkYq54='
WHERE
key_id = '9458aa3bf6f4253219b28df582724a9b8cdd3ec5a5c7cb3426d3122f21a12fb7'
AND (
token = 'Rr0FwMq4sFHBHYq1/zu/kOWHKA9j64EpIJQ3dtkYq54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)