UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qqaQw6in2iewipBO34RoroSfbQtmP0y201uBoFtmc6g='
WHERE
key_id = '2c8c1bb29a2d111195a75ab90315dfaf6f3b129288c1e8596a49b342157a4f98'
AND (
token = 'qqaQw6in2iewipBO34RoroSfbQtmP0y201uBoFtmc6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)