UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7pS0TG6brHEswX6L2HQeB2elB21OE1Zo6KTasFBadQI='
WHERE
key_id = 'e99c04da57ca9bb4c67ef285c4c899f287ab77e42bfd8e25f0e467131ec81a1c'
AND (
token = '7pS0TG6brHEswX6L2HQeB2elB21OE1Zo6KTasFBadQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)