UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IIHHiCvUHn/k2FJQizBflP6vNq/y71KVpC008/Fvg3Y='
WHERE
key_id = 'cc30f67b8669c82819e16fd5caf2a3d52d291d2c7db8dcd96d3b7cce77bd82df'
AND (
token = 'IIHHiCvUHn/k2FJQizBflP6vNq/y71KVpC008/Fvg3Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)