UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/WNM7v0Iw1pZixz9BOLoZRJpJ29S+LM9EBT/arNX+SY='
WHERE
key_id = '3f19a059dad98df3700a7166c15c47d7053aed22b9c09c8ce7cbc8206a68a61a'
AND (
token = '/WNM7v0Iw1pZixz9BOLoZRJpJ29S+LM9EBT/arNX+SY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)