UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3CUTGW+zGyRvfPjP9XsxogCVec75BLs62z4HW5u8mlY='
WHERE
key_id = '701a511d71440a726623c1d3299d1338ccadfd2ac544a2a1355bf841408a7f09'
AND (
token = '3CUTGW+zGyRvfPjP9XsxogCVec75BLs62z4HW5u8mlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)