UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NLi/g1Nvp8h4NuBISrSCI78dvxHpFZiqhLt3uymzEIw=' 
WHERE 
  key_id = '91cafe394df65cd219bd7fa9a87bedbfc2b8c40ab23a46b5b383447d7af213c7' 
  AND (
    token = 'NLi/g1Nvp8h4NuBISrSCI78dvxHpFZiqhLt3uymzEIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028