UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TJaMUqgrypFp6jnzuAW/B30b+YiLvbt5Gk7mS5p7N3k='
WHERE
key_id = '72dd2cd3c54efaab1f3cd21caaa8df3e36465e3f4e983d6c7a7bd6a57b559b8c'
AND (
token = 'TJaMUqgrypFp6jnzuAW/B30b+YiLvbt5Gk7mS5p7N3k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)