UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fHZeS25HRawVQq/bQoXy/jAtoCRHKHauS8WI+gE2IJU='
WHERE
key_id = 'fb62a5f1fb1d75829c6323241a39e71daf4e561fbd4db9c3a0f89841760025de'
AND (
token = 'fHZeS25HRawVQq/bQoXy/jAtoCRHKHauS8WI+gE2IJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)