UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KFHyupQetLzPNCZfZIJPZtifKJymHLrL261JsCOSqsQ='
WHERE
key_id = '752926ff0f493deaae1bb18f903f3b3391988d1a048e8e401eb7856faf34f76f'
AND (
token = 'KFHyupQetLzPNCZfZIJPZtifKJymHLrL261JsCOSqsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)