UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uEpGSvMWBf3pi7a5Vu4/H/ZEe2+T4frDAjQoKRaey1Q='
WHERE
key_id = '2fa876a72a4ff828e907b1b6a19878599b446eb9f6a30cf0184306fa09ef14ec'
AND (
token = 'uEpGSvMWBf3pi7a5Vu4/H/ZEe2+T4frDAjQoKRaey1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)