UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mgFKZ3RkHBNXIGXNodHhta8R9+rb43M6ZsNIwwZFf1g='
WHERE
key_id = '27028ec0ae6628acb5830e91e111bdcd4f506d61796aebbf63655bf0f555f7ae'
AND (
token = 'mgFKZ3RkHBNXIGXNodHhta8R9+rb43M6ZsNIwwZFf1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)