UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cloNp04dXS/FX2e6RIlLOIXQQlBe79Sn0fY46ra6n04='
WHERE
key_id = '895153d8c43e6697ea5625f892ea2b7df08f3ed2959ab301e8beda1467271e96'
AND (
token = 'cloNp04dXS/FX2e6RIlLOIXQQlBe79Sn0fY46ra6n04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)