UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PwmcwPVY0VjHm4efGVYmG8hoaOAeKIAlPNz7TRS9K0M='
WHERE
key_id = 'efdf63c59cee0c8d1d14e23db43457c2a4357f4473ec4dfda934ce70b6f1067a'
AND (
token = 'PwmcwPVY0VjHm4efGVYmG8hoaOAeKIAlPNz7TRS9K0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)