UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PHQftDs0PT64YkfYVXTgbNAdCMJKqX+ouC/Vy/ANT0Q='
WHERE
key_id = '1b7444d92299d989e51c72f5dc2d087999d69ecc99db3d98ce4db30292e5401e'
AND (
token = 'PHQftDs0PT64YkfYVXTgbNAdCMJKqX+ouC/Vy/ANT0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)