UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JU/T+os1PbbBnF7c434K9k3Wo2hONYkTctl2vyzZ68g=' 
WHERE 
  key_id = 'e3968b881ca26e4189207bca44e72bcddf7710266f22c7e2327c1ccc160bb03a' 
  AND (
    token = 'JU/T+os1PbbBnF7c434K9k3Wo2hONYkTctl2vyzZ68g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059