UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xxVICyMHSXnAM2ZNwiydvIyTfQfjGUNgRp+Wxx7meo8='
WHERE
key_id = 'a969790be4a9ff17551c9ac70ec3f1f2f381cae22d09e5240b2fc97d8cc345ec'
AND (
token = 'xxVICyMHSXnAM2ZNwiydvIyTfQfjGUNgRp+Wxx7meo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)