UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7MYqYN/YYIdx4a9Jd8O8lU40HZF0YuGyxYuQdglOnKw=' 
WHERE 
  key_id = '980ab4c60ab3e1c39736f37ea598c2b6a31fa7d8a2794d249e76e7c8101d389a' 
  AND (
    token = '7MYqYN/YYIdx4a9Jd8O8lU40HZF0YuGyxYuQdglOnKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016