UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zij0JNx9a2sM+oxGxf5iSkBnAv5PBnaaCw13QyhEgpw=' 
WHERE 
  key_id = '1949e5e93ce5849e2a400674e85b7855cd6e390a61aec2d6761b51f6daf10783' 
  AND (
    token = 'zij0JNx9a2sM+oxGxf5iSkBnAv5PBnaaCw13QyhEgpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017