UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oyxBT14OtW4cV5uwtOEscm8+DV80qnpVHm49TcrR/S0='
WHERE
key_id = 'af35cf894baddad7eea0fc7499e9b49a7e4b61f17489f583f2eb307c6f56807a'
AND (
token = 'oyxBT14OtW4cV5uwtOEscm8+DV80qnpVHm49TcrR/S0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)