UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LjUnv/Sev8p/pQQjF0LSt9TP2lLxHaXwGLKQlWG2Pt4=' 
WHERE 
  key_id = 'c99b35a7c7bb32cbebb296e946e28333009ff52f529b0c2f9f2f92c701f5ff4f' 
  AND (
    token = 'LjUnv/Sev8p/pQQjF0LSt9TP2lLxHaXwGLKQlWG2Pt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038