UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1NY9i1rvNAfTf64VovTrpLOkciKnA+Y5GPXn6yujGTM='
WHERE
key_id = '760d3370fe0c35203d5188c0e493bcef27de7d447f06c47e579d28c1211c4520'
AND (
token = '1NY9i1rvNAfTf64VovTrpLOkciKnA+Y5GPXn6yujGTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)