UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zSfaDLvbGFOQvtJ9OS/GCIb5XJH0rACm1GQHT9BeEws='
WHERE
key_id = '4f2ba1076007ac19eaee6660f545bd1a40fd4eca2463068fe0028f4d8d015eb5'
AND (
token = 'zSfaDLvbGFOQvtJ9OS/GCIb5XJH0rACm1GQHT9BeEws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)