UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WLrQwKoZHxQsnPV8PZLi4VSlqZpBFW3bQAPMrE15DNQ='
WHERE
key_id = '89c08f576405461a73eb382feb2833532b278b7afc9720211b70eeb3bc48354c'
AND (
token = 'WLrQwKoZHxQsnPV8PZLi4VSlqZpBFW3bQAPMrE15DNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)