UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2oiy28pCmlmHpxDQjHstaXOVNP2evJg/8ydCn2xxuKg=' 
WHERE 
  key_id = '91aecadcd95bdfedc742a2f54e7c846b15ebab07c6e5c014e92afe07ece20cb3' 
  AND (
    token = '2oiy28pCmlmHpxDQjHstaXOVNP2evJg/8ydCn2xxuKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047