UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VRvtbNlkOrxLm3F4X9Dw2BeuG9LX+LrGJfjH4StO8AQ='
WHERE
key_id = '16933c7057c8062b303f15a9077e0667d4ad4768193910dff53e3459d7a686a0'
AND (
token = 'VRvtbNlkOrxLm3F4X9Dw2BeuG9LX+LrGJfjH4StO8AQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)