UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FnrmbZrpg0JOspdwlVvHvSF5l62/nWSZFHNE4ihBCI8=' 
WHERE 
  key_id = 'cc49f49ff7344f7b8bee139c1bc154a90e8e531ac691bd4598a812d66fa97c1a' 
  AND (
    token = 'FnrmbZrpg0JOspdwlVvHvSF5l62/nWSZFHNE4ihBCI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047